/*
 * @Author: weikang
 * @Description:
 * @Date: 2024-03-10 18:59:51
 * @LastEditTime: 2024-05-05 13:18:36
 * @FilePath: \env-manager-pc\src\api\modules\update.ts
 */
import api from '../index'
import type { UpdateFileForm } from '@/views/update/file/page'

export default {
  // 企业采集成功率
  GetEnterpriseCollectRangeStat: (data: { startTime: string, endTime: string, objFilter: any, pageSize: number, pageNum: number }) => api<any>({
    url: `/Env/Data/GetEnterpriseCollectRangeStat`,
    method: 'post',
    data,
  }),
  // 召测升级信息
  CallLastUpgrades: (data: { deviceObjIDs: string[] }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/CallLastUpgrades`,
    method: 'post',
    data,
  }),
  // 升级列表
  GetLastUpgrades: (data: { objFilter: any, pageSize: number, pageNum: number }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/GetLastUpgrades`,
    method: 'post',
    data,
  }),
  // 召测版本
  CallVersions: (data: { deviceObjIDs: string[] }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/CallVersions`,
    method: 'post',
    data,
  }),
  // 升级方案(全部)
  GetUpgradeFiles: (data: { name: string, ver: string, pageSize: number, pageNum: number }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/GetUpgradeFiles`,
    method: 'post',
    data,
  }),
  // 创建升级方案(全部)
  AddUpgradeFile: (data: { upgradeFile: UpdateFileForm }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/AddUpgradeFile`,
    method: 'post',
    data,
  }),
  // 修改升级方案(全部)
  UpdateUpgradeFile: (data: { fileGUID: string, upgradeFile: UpdateFileForm }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/UpdateUpgradeFile`,
    method: 'post',
    data,
  }),
  // 删除升级方案(全部)
  DeleteUpgradeFile: (data: { fileGUID: string }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/DeleteUpgradeFile`,
    method: 'post',
    data,
  }),
  // 升级状态
  GetUpgradeStates: () => api<any>({
    url: `/Obj/Device/HJ212/GYHR/GetUpgradeStates`,
    method: 'post',
  }),
  // 开始升级
  StartUpgrades: (data: { deviceObjIDs: string[], fileID: string }) => api<any>({
    url: `/Obj/Device/HJ212/GYHR/StartUpgrades`,
    method: 'post',
    data,
  }),
}
